Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Turn your JavaScript objects into CSS classes.
Designed with React and Browserify in mind.
npm install rcss
Demo of the example folder output here. No CSS files involved.
button.js:
var RCSS = require('RCSS');
var button = {
display: 'inline-block',
padding: '6px 12px',
// CamelCased. Transformed back into the dashed CSS counterparts on-the-fly.
marginBottom: '0',
':hover': {
color: 'blue'
}
};
module.exports = RCSS.registerClass(button);
index.js
/** @jsx React.DOM */
var React = require('React');
var RCSS = require('RCSS');
var button = require('./button');
RCSS.injectAll();
React.renderComponent(
<button className={button.className}>Hello!</button>,
document.body
);
Easy =).
Wrap the style declaration and register it internally. Returns a new object of the format: {className: 'uniqueClassName', style: originalStyleObj}
. You can then use to the opaque className and the style object however you want.
A top-level call that parses all the registered style objects into real CSS, puts the result in a style tag, and injects it in the document head
. This clears the styles registry.
A simple merge utility that returns a new object. Typically used this way.
For server-side rendering, you'd want the big style string instead of calling injectAll()
. In fact, injectAll()
is nothing but a helper that takes the output of getStylesString
, creates a tag and fill the content, and puts it in head
.
require
implementation you use (Browserify, Webpack, etc.), so there's no extra compilation step.MIT.
FAQs
Turn your JavaScript objects into CSS classes.
We found that rcss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.